I. Field of the Invention
The present invention relates to a bar-code reading apparatus and, more particularly, to an apparatus which eliminates noise components included in a bar code and extracts correct data.
II. Description of the Prior Art
FIG. 3 is a block diagram showing a schematic arrangement of a conventional bar-code reading apparatus. Reference numeral 1 denotes a bar code; 2, a light source for illuminating the bar code; 3, a photoelectric transducer for receiving and photoelectrically converting light reflected by the bar code; 4, an amplifier for amplifying a photoelectrically converted signal and outputting an analog signal. Reference numeral 5 denotes a peak hold circuit for holding a peak value of the analog signal; 6, a comparator for comparing the held peak value with an original signal; 7, an output circuit for outputting a digital signal corresponding to the bar code in accordance with an output from the comparator; and 8, a light source driver.
FIG. 4 shows a detailed circuit arrangement of the peak hold circuit 5 and the comparator 6 in the conventional bar-code reading apparatus. An analog signal output from the amplifier 4 is voltage-divided by resistors R.sub.1, R.sub.2, and R.sub.3, and signals a, b, and c are extracted. The signal b represents an original signal. As shown in FIG. 5(a), when peak values d.sub.1 and d.sub.2 of the signals a and c are held and these levels are simultaneously inverted with respect to the original signal b, an output level of the comparator 6 is changed from low to high or from high to low, thereby obtaining a signal corresponding to the bar code, as shown in FIG. 5(b). More specifically, the peak value d.sub.1 of the signal a determines a changing point from black to white, and the peak value d.sub.2 of the signal c determines a changing point from white to black. (Note that a level of an output from the output circuit 7 is opposite to that of the output from the comparator, and a block portion is set at high level.)
FIG. 6 shows another conventional arrangement of the peak hold circuit. In FIG. 6, a threshold value of the changing point from white to black or from black to white is set using a forward voltage drop Vf of a diode, as shown in FIG. 7.
However, with the above conventional arrangements, as shown in FIGS. 4 and 5, since the analog singal is voltage-divided by fixed resistors connected in series to extract the original signal and the comparison signal, a difference in the levels among the signals is constant by voltage-division resistors, and therefore the threshold value cannot be changed. This can be applied to FIGS. 6 and 7.
As shown in FIGS. 8(a), 8(b), and 8(c), however, assuming that a space portion (white) of the bar code is contaminated, that a bar portion (black) is printed by a dot printer, or that the black portion is partially omitted, bar-code data which can be actually read out includes a lot of noise. If a noise level exceeds the difference in the levels among the signals, the signal output from the output circuit is different from the desired signal which is represented by a dotted line.